﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cricket.LinqModel
{
    public interface IDataRepository
    {
        #region Admin
        void CreateAdmin(Admin admin);
        void UpdateAdmin(Admin admin);
        List<Admin> GetAllAdmin();
        List<AdminResult> GetAdminDetailsById(int Id);
        void DeleteAdmin(Admin admin);
        List<SpLoginUserResult> GetAdminByCredential(string username, string password, string password2);
        void UpdateAdminFlag(Admin admin);
        List<GetCommonRateResult> GetCommonRate(int adminId);
        List<Admin> GetInActiveAdmin();
        #endregion

        #region Admin Credentaial
        void CreateAdminCredential(AdminCredential adminCredentail);
        void DeleteAdminCredentail(AdminCredential adminCredentail);
        void UpdateAdminCredentials(AdminCredential adminCredential);
        void UpdateAdminCredentialsMyProfile(AdminCredential adminCredential);
        #endregion

        #region Client
        void CreateClient(Client client);
        List<GetAllClientsResult> GetAllClient();
        void DeleteClient(Client client);
        void GetClientById(Client client);
        void UpdateClient(Client client);
        List<GetClientsByAdminIdResult> GetClientsByAdminId(int AdminId);
        List<Client> CheckUserNameExist(int ClientId, string username);
        List<ClientLoginResult> ClientLogin(string username, string password);
        List<GetTopClientForSuperAdminResult> GetTopClientForSuperAdmin();
        List<GetTopClientForAdminResult> GetTopClientForAdmin(int AdminId);
        decimal? GetClientBettingLimit(int clientId);
        decimal? GetMatchClientBettingLimit(int clientId);
        void UpdateClientLimit(int clientId, string limit);
        void UpdateClientMatchLimit(int matchScheduleId, int clientId);
        List<GetMinAmountResult> GetMinAmount(int clientId, int matchScheduleId);
        List<GetTotalOfSessionResult> GetTotalOfSession(int clientId, int matchScheduleId);
        void UpdateClientLimitFromMatch(int ClientId);
        void UpdateClientLimitForSession(int ClientId);
        void UpdateClientLimitFromNineEleven(int ClientId);
        List<GetMinAmountForMatchResult> GetMinAmountForMatch(int MatchId, int ClientId);
        List<GetTotalAmountForSessionResult> GetTotalAmountForSession(int MatchId, int ClientId);
        
        List<GetFancy90110AmountResult> GetFancy90110Amount(int MatchId, int ClientId);
        void UpdateClientLimitByAdmin(Client client);
        List<GetAllInActiveClientsResult> GetAllInActiveClient();
        List<GetInActiveClientsByAdminIdResult> GetInActiveClientsByAdminId(int AdminId);
        void UpdateIsLoginForClient(Client client);
        void UpdateIsReloadForClient(Client client);
        List<GetAllLoginClientsResult> GetAllLoginClient();
        List<GetAllReloadClientsResult> GetAllReloadClients();
        List<GetAllLoginByAdminResult> GetAllLoginByAdmin(int AdminId);
        void LogoutAllClient();
        void ReloadAllClient();
        void UpdateClientLimitByClient(int clientId, decimal? limit);
        #endregion 

        #region Team
        void CreateTeam(Team team);
        List<Team> GetAllTeam();
        List<GetAllTeamsResult> GetAllTeams();
        void DeleteTeam(Team team);
        void GetTeamById(Team team);
        void UpdateTeam(Team team);
        List<Team> CheckTeamNameExist(int TeamId, string teamName);
        List<Team> CheckAbbrivationExist(int TeamId, string abbrivation);
        List<Team> GetTeamsBySeriesId(int SeriesId);
        #endregion

        #region Series
        void CreateSeries(Series series);
        List<Series> GetAllSeries();
        void DeleteSeries(Series series);
        void GetSeriesById(Series series);
        void UpdateSeries(Series series);
        List<Series> CheckSeriesNameExist(int SeriesId, string teamName);
        List<Series> CheckSeriesAbbrivationExist(int TeamId, string abbrivation);
        #endregion

        #region Match Schedule
        void CreateMatchSchedule(MatchSchedule matchSchedule);
        List<GetAllMatchesResult> GetAllMatches();
        void DeleteMatche(MatchSchedule matchSchedule);
        void GetMatchesById(MatchSchedule matchSchedule);
        void UpdateMatchSchedule(MatchSchedule matchSchedule);
        List<MatchSchedule> CheckMatchExist(int matchId, int team1, int team2, DateTime date);
        List<GetTodayMatcheResult> GetTodayMatches(int matchType);
        List<GetMatchDetailsResult> GetMatchDetails(int matchId);
        List<GetTodayMatcheForClientResult> GetTodayMatchesForClient();
        List<GetTeamsByMatchResult> GetTeamsByMatch(int MatchId);
        List<GetMatchTypeByMatchIdResult> GetMatchTypeByMatchId(int MatchId);
        List<GetUpComingMatchesResult> GetUpComingMatches();
        List<GetMatchesForMatchResultResult> GetMatchesForMatchResult();
        List<GetMatchesForReportResult> GetMatchesForReport();
        List<GetTeamNameByMatchDetailResult> GetTeamNameByMatchDetail(int MatchId);
        List<GetAllMatchesForDeleteResult> GetAllMatchesForDelete();
        void DeleteData(int MatchId);
        #endregion

        #region BettingType
        void CreateBettingType(BettingType bettingType);
        List<BettingType> GetAllBettingType();
        void DeleteBettingType(BettingType bettingType);
        void GetBettingTypeById(BettingType bettingType);
        void UpdateBettingType(BettingType bettingType);
        #endregion

        #region MatchType
        void CreateMatchType(MatchType matchType);
        List<MatchType> GetAllMatchType();
        void DeleteMatchType(MatchType matchType);
        void GetMatchTypeById(MatchType matchType);
        void UpdateMatchType(MatchType matchType);
        #endregion

        #region Betting
        void CreateBetting(Betting betting);
        void UpdateBetting(Betting betting);
        void UpdateBettingForMatch(Betting betting);
        void UpdateBettingForDraw(Betting betting);
        void UpdateBettingForTie(Betting betting);
        int StopAllBetting(int? AdminId);
        List<EditAdminBetResult> EditAdminBetting(int MatchId, int BetTypeId, int AdminId);
        List<Betting> GetBettingStatus(int BettingId);
        #endregion

        #region Customer Betting
        List<GetSessionBettingForClientResult> GetSessionBettingForClient(int adminId, int matchId, int bettingType);
        void CreateCustomerBetting(List<CustomerBetting> customerBettings);
        List<UpdateTeamARecordsResult> UpdateTeamARecords(int MatchId, int TeamId);
        List<UpdateTeamBRecordsResult> UpdateTeamBRecords(int MatchId, int TeamId);
        void UpdateTeamA(int MatchId);
        void UpdateTeamB(int MatchId);
        void UpdateDraw(int MatchId);
        void UpdateTie(int MatchId);
        List<ClientMatchLedgerResult> ClientMatchLedger(int AdminId, int MatchId, int ClientId);
        List<ClientSessionLedgerResult> ClientSessionLedger(int AdminId, int MatchId, int ClientId);
        List<ClientCommissionLedgerResult> ClientCommissionLedger(int MatchId, int ClientId);
        
        List<AdminMatchLedgerResult> AdminMatchLedger(int AdminId, int MatchId);
        List<AdminSessionLedgerResult> AdminSessionLedger(int AdminId, int MatchId);
        List<AdminCommissionLedgerResult> AdminCommissionLedger(int AdminId, int MatchId);
        List<IsDuplicateRecordResult> IsDuplicateRecord(int MatchScheduleId, int BettingId, string BetFor, int CreatedBy, string BettingAmount);
        #endregion

        #region Score
        void CreateScore(Score score);
        List<CheckMatchIdExistResult> CheckMatchIdExist(int MatchId, int TeamId);
        void UpdateScore(Score score);
        List<GetScoreByMatchIdResult> GetScoreByMatchId(int MatchId);
        #endregion

        #region Result
        void CreateResult(Result result);
        //List<GetOversByTeamIdAndMatchIdResult> GetOverByTeamIdAndMatchId(int TeamId, int MatchId);
        List<GetOversByTeamIdAndMatchIdResult> GetOversByTeamAndMatch(int TeamId, int MatchId);
        List<GetOversByMatchIdResult> GetOversByMatch(int MatchId);
        void CalculateWinningResultsForCustomers(int matchScheduleId, int bettingTypeId, int matchTypeId, int over, int TeamId);
        void CalculateNineEleven(int matchScheduleId, int bettingTypeId, int matchTypeId, int over, int TeamId);
        #endregion

        #region Session Result
        void DeleteAndCreate(MatchSessionResult matchSessionResult);
        void Delete(MatchSessionResult matchSessionResult);
        List<MatchSessionResult> GetMatchSessionResultByTeam(int MatchId, int TeamId);
        void UpdateMatchSessionResult(MatchSessionResult matchSessionResult);
        #endregion

        #region
        void CreateTossWinner(TossWinnerTeam tossWinnerTeam);
        #endregion

        #region AdminToss
        void CreateAdminToss(AdminToss adminToss);
        List<AdminToss> checkMatchExistOrNot(int matchId);
        void UpdateAdminToss(AdminToss adminToss);
        List<GetActiveMatchByIdResult> GetActiveMatchById(int MatchId);
        #endregion

        #region TossBetting
        void CreateTossBetting(TossBetting tossBetting);
        #endregion

        #region Commission Amount
        void CreateCommissionAmount(CommissionAmount commissionAmount);
        #endregion

        #region FancyNineEleven
        void CreateFancyNineEleven(FancyNineEleven fancyNineEleven);
        void UpdateFancyNineEleven(FancyNineEleven fancyNineEleven);
        List<GetFancyNineElevenResult> GetFancyNineEleven(int adminId, int matchId, int bettingType);
        #endregion

    }
}
